home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-09-14 | 2.2 KB | 83 lines | [TEXT/GEOL] |
- Item 2453424 14-Sept-89 16:45
-
- From: KAMAN Kaman Sciences, D Holmgren,PRT
-
- To: MACAPP.TECH$ MACAPP Tech
-
- Sub: MPW PASCAL 3.0 Bug?
-
- I have a question regarding code generated by the MPW Pascal 3.0 compiler.
- The following code segments each contain a method call. The first method call
- restores A0 when it returns, and happily uses the register.
- The second code segment, upon return from the JSR, does not restore A0 (which,
- being a scratch register, was modified in the ConstructTemplates method), and
- thus walks on memory.
-
-
- Code segment 1:
-
- PROCEDURE TExperiment.IExperiment;
-
- VAR
- aStr: Str255;
- theTime:LONGINT;
-
- BEGIN
- IDocument (kExpFileType, kSignature, kUsesDataFork, kUsesRsrcFork,
- NOT kDataOpen, kRsrcOpen);
- .
- .
- .
- SetExperimentTitle;
- fAutoArm := FALSE;
- fAutoReadout := FALSE;
- fAutoProcess := FALSE;
- .
- .
- .
- END; { TExperiment.IExperiment }
-
-
- The interior lines are, when disassembled,
-
- 00000126: 4EBA 0000 'N...' JSR
- TEXPERIMENT$SETEXPERIMENTTITLE ; id: 33
- 0000012A: 2054 ' T' MOVEA.L (A4),A0
- 0000012C: 4228 02B3 'B(..' CLR.B $02B3(A0)
- 00000130: 4228 02B4 'B(..' CLR.B $02B4(A0)
- 00000134: 4228 02B5 'B(..' CLR.B $02B5(A0)
-
-
- Code segment 2:
-
- PROCEDURE TMyChanMgr.IChanMgr;
- BEGIN
- IDocument (kChanDefFileType, kSignature, kUsesDataFork, NOT kUsesRsrcFork,
- NOT kDataOpen, NOT kRsrcOpen);
- .
- .
- .
- fPulseChan3 := 7;
- fBaseCalDelay := 1;
- ConstructTemplates;
- fBaseCtlString := kNull;
- fDataCtlString := kNull;
- .
- .
- .
- END; { TMyChanMgr.IChanMgr }
-
-
- The interior lines are, when disassembled,
-
- 000000F6: 317C 0007 04F0 '1|....' MOVE.W #$0007,$04F0(A0)
- 000000FC: 317C 0001 04F2 '1|....' MOVE.W #$0001,$04F2(A0)
- 00000102: 2F0B '/.' MOVE.L A3,-(A7)
- 00000104: 4EBA 0000 'N...' JSR
- TMYCHANMGR$CONSTRUCTTEMPLATES ; id: 48
- 00000108: 4228 01EA 'B(..' CLR.B $01EA(A0)
- 0000010C: 4228 03EA 'B(..' CLR.B $03EA(A0)
-
- Any comments?
-
-